package com.ycr.springmvc.listener;

import org.springframework.context.ApplicationListener;

import com.ycr.springmvc.event.MethodExecutionEvent;

public class MethodExecutionEventListener implements ApplicationListener<MethodExecutionEvent> {

	@Override
	public void onApplicationEvent(MethodExecutionEvent event) {
		if ("begin".equals(event.getMethodExecutionStatus())) {
			System.out.println("It's beginning"); 
		}
		
		if ("end".equals(event.getMethodExecutionStatus())) {
			System.out.println("It's  ending"); 
		}
	}
}
